<div class="fl pdl6 bgr_arrowleft">
  <div class="item bgr_fff pdt12 pdb12 gray">
    <div id="closepop" class="fr bder_rds100 bder_d5 pdl6 pdr6 cursor_poiter bold txt_center bgr_143167 white mgr-12 mgt-18  pst_relative zindex10" onClick="Closepop('6');">X</div>
    <div class="fl w256 pdl20">
      <select onchange="disable_value();" id="departfrom" height="28" class="fl w258 bder_d5 pdl2p mgt6">
        <option value="0">Depart from</option>
        <option value="1"<?php if($_GET['departfrom']==1) echo "selected='selected'" ?>>Nyaung-U (Bagan)</option>
        <option value="2"<?php if($_GET['departfrom']==2) echo "selected='selected'" ?>>Heho (Inle)</option>
        <option value="3"<?php if($_GET['departfrom']==3) echo "selected='selected'" ?>>Mandalay</option>
        <option value="4"<?php if($_GET['departfrom']==4) echo "selected='selected'" ?>>Yangon</option>
      </select>
      <select id="arriveto" height="28" class="fl w258 bder_d5 pdl2p mgt6">
        <option value="0">Arrive to</option>
        <option value="1"<?php if($_GET['arriveto']==1) echo "selected='selected'" ?>>Nyaung-U (Bagan)</option>
        <option value="2"<?php if($_GET['arriveto']==2) echo "selected='selected'" ?>>Heho (Inle)</option>
        <option value="3"<?php if($_GET['arriveto']==3) echo "selected='selected'" ?>>Mandalay</option>
        <option value="4"<?php if($_GET['arriveto']==4) echo "selected='selected'" ?>>Yangon</option>
      </select>
      <select id="flight_adult" height="28" class="fl w120 bder_d5 pdl2p mgt6">
        <option value="0">Adult</option>
        <?php for($i=1;$i<20;$i++){if($i<10){?>
        <option value="<?php echo $i?>"><?php echo '0'.$i?></option>
        <?php }else{?>
        <option value="<?php echo $i?>"><?php echo $i;?></option>
        <?php }
		      } ?>
      </select>
      <select id="flight_child" height="28" class="fr w120 bder_d5 pdl2p mgt6">
        <option value="0">Children</option>
        <?php for($i=1;$i<20;$i++){if($i<10){?>
        <option value="<?php echo $i?>"><?php echo '0'.$i?></option>
        <?php }else{?>
        <option value="<?php echo $i?>"><?php echo $i;?></option>
        <?php }
		      } ?>
      </select>
      <div class="fl w130 pdt3"> <span class="fl pdt1">Round-trip</span>
        <input type="checkbox" onclick="checkdrop_chkroundtrip();" id="chkroundtrip"/>
      </div>
      <div class="fl w82 pdt3 pdl4"> <span class="fl pdt1">One way</span>
        <input type="checkbox" onclick="checkdrop_chkoneway();" id="chkoneway"/>
      </div>
      <div class="item">
        <div class="fl w122 pdb20 pdt3" id="box_departure"> Departure date<br>
          <input id="departure" onclick="drop_select();" type="text" class="item bder_d5 h23 txt_indent10 gray datepicker mgt3" placeholder="00/00/00"/>
        </div>
        <div class="fr w122 pdb20 pdt3" id="box_returning"> Returning date<br>
          <input id="returning" type="text" class="item bder_d5 h23 txt_indent10 gray datepicker mgt3" placeholder="00/00/00"/>
        </div>
      </div>
      <input type="button" onclick="return check_flights();" class="fr bgr_143167 white pdt4 pdb6 pdr7 pdl7 ff_museo500 f17 bder0 cursor_poiter mgr-2" value="CHECK NOW"/>
    </div>
  </div>
</div>
<script type="text/javascript">
	function drop_select(idname){				
		if($('#'+idname).val()!=0){					
			$('#'+idname).removeClass('bxshadow_ff0000');	
		}else{
			$('#'+idname).addClass('bxshadow_ff0000');	
			return false;
		}
	}
	
	function check_flights(){
		check=drop_select('departfrom');
		if(check==false) return false;
		check=drop_select('arriveto');
		if(check==false) return false;
		check=drop_select('flight_adult');
		if(check==false) return false;

		if($('#chkroundtrip').is(":checked")==false && $('#chkoneway').is(":checked")==false){
			$('#chkroundtrip').attr('required','required');
			$('#chkoneway').attr('required','required');
		}else{
			$('#chkroundtrip').removeAttr('required','required');
			$('#chkoneway').removeAttr('required','required');
		}
		
		if($('#chkroundtrip').is(":checked")==true){
			if($('#departure').val()!=""){
				if($('#returning').val()!=""){							
					location.assign('<?php echo base_url();?>home/flight/oneway?departfrom='+$('#departfrom').val()+'&arriveto='+$('#arriveto').val()+'&adult='+$('#flight_adult').val()+'&child='+$('#flight_child').val()+'&departuredate='+$('#departure').val()+'&returningdate='+$('#returning').val());
				}else{ return false;}
			}else {return false;}
		}else if($('#chkoneway').is(":checked")==true){
			if($('#departure').val()!=""){
				location.assign('<?php echo base_url();?>home/flight/oneway?departfrom='+$('#departfrom').val()+'&arriveto='+$('#arriveto').val()+'&adult='+$('#flight_adult').val()+'&child='+$('#flight_child').val()+'&departuredate='+$('#departure').val());	
			}else {return false;}
		}
	}
</script>
